<%--
 *  File:    DevelopAndOpenaccountEdit.jsp
 *  @Author: jackwang	
 *  Date:    2013/7/4
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.DevelopAndOpenaccountEdit");
  String strModuleName = "COM";
  String strTableName = "v_opencriterion";
  String privilegeCode = "A01002";
  String contextPath = request.getContextPath();

%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<%@include file="/inc/Print.inc"%>
<html>
<head>
<title>DevelopAndOpenaccountEdit.jsp</title>
<PageFlow:CheckPageFlow pageName="p_opencriterion"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<iframe name="reloadHandler" style="display:none"></iframe>
<link rel="stylesheet" href="<%=contextPath %>/css/cn/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/js/FuncLib.js"></script>
<script language="JavaScript" src="<%=contextPath %>/css/cn/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%
	Vector searchresults = (Vector)pageContext.getAttribute("searchresults");
	if(searchresults == null) searchresults = new Vector();
	String  isfirst = (String) pageContext.getAttribute("isfirst");
%>
<style type="text/css">
<!--
body{
	margin:0;padding:0;
}
.div1 {
clear: both;
float:left;
height:10px;
border: 0px solid #EEEEEE;
padding:0px;
margin:0px 0px 0px 0px;
}
.div2 {
clear: both;
height:10px;
float:left;
}
.div3 {
clear: both;
height:10px;
float:left;
}
-->
</style>
<script>
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  editform.action = "DevelopAndOpenaccountEdit.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();  
}
function monthresult(){
	document.cform.actionname.value = "save";
  	document.cform.target = "_self";
  	isRunning = true;
  	document.cform.submit();
}
function page_add(){
    if(!checkForm(document.cform))return;
	document.cform.actionname.value = "add";
  	document.cform.target = "_self";
  	isRunning = true;
  	document.cform.submit();
}
window.onload=function(){
          // cform.startdate.value=new Date().toFormatString("yyyy-mm-dd");
          // cform.enddate.value=new Date().toFormatString("yyyy-mm-dd");
}
function popAreaNew(num){
	if(popwindow!=null) popwindow.close();
	if(num != null || num == ''){
		document.cform.currentnum.value=num;
 	}else{
 	 	document.cform.currentnum.value='';
 	}
    if(isEmpty(document.cform.areaid1.value)){
      alert("请选择省区！");
      document.cform.stdareaname.focus();
      return;
    }
    if(isEmpty(document.cform.deptid.value)){
      alert("请选择部门！");
      document.cform.deptid.focus();
      return;
    }
	var currentnum = document.cform.currentnum.value;
    url = 'AreaPopWindow.jsp?areaid1='+document.cform.areaid1.value+'&deptid='+document.cform.deptid.value+'&<%= OvalTools.randomURL() %>';
    attribute = 'height=300, width=500,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no';

	popwindow = window.open(url,'newwindow', attribute);
}
function SetAreaPop(areaid,areacode,areaname){
	var currentnum = document.cform.currentnum.value;
	document.cform['areaid2'+currentnum].value = areaid;
	//document.cform['businessareacode'+currentnum].value = areacode;
	document.cform['areaname'+currentnum].value = areaname;
}
function popBusinessarea(num){
    //url = "UserAreaAllWindow.jsp?<%= OvalTools.randomURL() %>";
    if(num != null || num == ''){
		document.cform.currentnum.value=num;
 	}else{
 	 	document.cform.currentnum.value='';
 	}
 	var currentnum = document.cform.currentnum.value;
    url = "<%=contextPath%>/zylprocessgoals/UserStdAreaAllWindow.jsp?<%= OvalTools.randomURL() %>";
    attribute = "height=400, width=650,top=100,left=100,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no";
	popwindow = window.open(url,"newwindow", attribute);
}
function set_orgNameByAreaWindow(id,value,valuename){
    var currentnum = document.cform.currentnum.value;
    document.cform['areaidstr'+currentnum].value = value;
    document.cform['stdareaname'+currentnum].value = valuename;
    //var s = document.cform.areaidstr.value;
    //document.cform.arraystr.value = s.split(",");// 在每个逗号(,)处进行分解。
}
function set_orgNameByAreaWindow1(id,areaname){
    var currentnum = document.cform.currentnum.value;
    document.cform['areaid1'+currentnum].value = id;
    document.cform['stdareaname'+currentnum].value = areaname;
}
function popWindowsContactProd(num){
    if(num != null || num == ''){
		document.cform.currentnum.value=num;
 	}else{
 	 	document.cform.currentnum.value='';
 	}
 	var currentnum = document.cform.currentnum.value;
 	if(isEmpty(document.cform['criteriontype'+currentnum].value)){
      alert("请选择标准类型！");
      document.cform['criteriontype'+currentnum].focus();
      return;
    }
    if(isEmpty(document.cform['deptid'+currentnum].value)){
      alert("请选择部门！");
      document.cform['deptid'+currentnum].focus();
      return;
    }
    var criteriontype=document.cform['criteriontype'+currentnum].value;
    if(criteriontype==1)  document.cform['datacategory'+currentnum].value=7;
    if(criteriontype==2)  document.cform['datacategory'+currentnum].value=8;
    //if(criteriontype==3)  document.cform['datacategory'+currentnum].value=14;
    if(criteriontype==3)  document.cform['datacategory'+currentnum].value=7;
    if(popwindow!=null) popwindow.close();
    if(document.cform['criteriontype'+currentnum].value ==3){
 	popwindow = window.open("<%=contextPath%>/masterdata/ogm/ProductbrandPopWindow.jsp?<%= OvalTools.randomURL() %>&zyldatacategory="+document.cform['datacategory'+currentnum].value, "newwindow", "height=400, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=yes")
    }else{
    popwindow = window.open("<%=contextPath%>/masterdata/ogm/ProductbrandPopWindow.jsp?<%= OvalTools.randomURL() %>&zyldatacategory="+document.cform['datacategory'+currentnum].value+'&deptid='+document.cform['deptid'+currentnum].value, "newwindow", "height=400, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=yes")
    }
}
 function set_orgNameByPopWindow(id,code,name){
    if(document.cform.issearch.value != 'Y')
    {
    var currentnum = document.cform.currentnum.value;
    idObj=document.getElementById("productgroupid"+currentnum);
    nameObj=document.getElementById("productgroupname"+currentnum);
    //captionname=document.getElementById("captionname"+idx);
	nameObj.value=name;
	//captionname.value=name;
	idObj.value=id;
    //document.getElementById("captionname"+idx).command="notnull";
    }else{
     document.cform.pdgroupid.value =id;
     document.cform.pdgroupname.value= name;
    }
}
function popContactProd(){
    document.cform.issearch.value='Y';
    var criteriontype=document.cform['searchcriteriontype'].value;
    if(criteriontype==1)  document.cform['datacategory'].value=7;
    if(criteriontype==2)  document.cform['datacategory'].value=8;
    //if(criteriontype==3)  document.cform['datacategory'].value=14;
    if(criteriontype==3)  document.cform['datacategory'].value=7;
    if(popwindow!=null) popwindow.close();
 	popwindow = window.open("<%=contextPath%>/masterdata/ogm/ProductbrandPopWindow.jsp?<%= OvalTools.randomURL() %>&zyldatacategory="+document.cform['datacategory'].value, "newwindow", "height=400, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=yes")

}
/*
function showdiv(num){
    if(num != null || num == ''){
		document.cform.currentnum.value=num;
 	}else{
 	 	document.cform.currentnum.value='';
 	}
 	var currentnum = document.cform.currentnum.value;
 	if(document.cform['criteriontype'+currentnum].value==3 && document.cform['opentype'+currentnum].value==2){
 	 document.cform['analyzecriteria'+currentnum].disabled='';
 	 document.cform['analyzecriteria'+currentnum].command="notnull";
 	}else{
 	 document.cform['analyzecriteria'+currentnum].disabled=true;
 	}
}*/
  function page_delete()
  {
    if(isNullChecked(cform.deleteids))
    {
        alert("<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD_TO_DEL") %>");
        return;
    }
    if(!confirm("<%= message.getMessageDesc("ARE_YOU_SURE_DEL") %>")) return;
    
    cform.actionname.value = "delete";
    cform.target = "_self";
    isRunning = true;
	cform.submit();
  }
function page_popBusinessarea(num)
{
  if(num != null || num == ''){
	 document.cform.currentnum.value=num;
  }else{
 	 document.cform.currentnum.value='';
  }
  //var currentnum = document.cform.currentnum.value;
  if (typeof popwindow != 'undefined') popwindow.close();
  popwindow = window.open("<%=contextPath%>/masterdata/ogm/zylstdbusinessareapop.jsp?<%= OvalTools.randomURL() %>&languagecode=<%= strLanguageCode %>","newwindow", "height=300, width=800,top=100,left=100,toolbar=n0, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
	
}
function setContact(id,type,name){
  var currentnum = document.cform.currentnum.value;   
  if(currentnum != null || currentnum == ''){
	 document.cform['areaid1'+currentnum].value=id;
     document.cform['stdareaname'+currentnum].value=name;
  }else{
 	 document.cform.regionareaid.value=id;
     document.cform.regionname.value=name;
  }
}
function popBusinessarea_moulty(){
	if(popwindow!=null) popwindow.close();
	
    url = '<%=contextPath %>/zyl/masterdata/map/SelectAreaTree.jsp?<%= OvalTools.randomURL() %>';
    attribute = 'height=540, width=250,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no';
	popwindow = window.open(url,'newwindow', attribute);
}
function setAreas(areaids,areanames,areacodes){

	document.cform.areaids.value = areaids;
	document.cform.businessareanames.value = areanames;
	//document.cform.businessareacode.value = areacodes;
} 
function showdiv(){
  var criteriontype=document.cform.criteriontype.value;
  document.getElementById("div1").style.display="none";
  document.getElementById("div2").style.display="none";
  document.getElementById("div3").style.display="none";
  alert(criteriontype);
  if(!isEmpty(criteriontype)){
    if(criteriontype==2){
      document.getElementById("div"+criteriontype).style.display="block";
    }else{
      document.getElementById("div1").style.display="block";
    }
  }
}
function selectattribute(){
  clearprd();
  document.getElementById("div1").style.display="block";
  var criteriontype = document.cform.criteriontype.value;
  if(criteriontype==2){
    criteriontype=1;
  }
  var  datahandler = new  DataHandler() ;

  datahandler.add_params("criteriontype" , criteriontype,"integer") ;
  datahandler.add_params("languagecode" , 'cn',"string") ;
  datahandler.getResultFromVector("attribute1","valuename" ,"value" ,"document.cform.analyzecriteria") ;
  datahandler.add_job("j_attribute1") ;
  datahandler.runDataHandler ();
}
function clearprd(){
  document.getElementById("productgroupid").value="";
  document.getElementById("productgroupname").value="";
}
function page_save(){
	document.cform.actionname.value = "save";
  	document.cform.target = "_self";
  	isRunning = true;
  	document.cform.submit();
}
</script>

</head>
<body style="overflow: auto;">
<iframe id="reloadHandler" name="reloadHandler" style="display:none"></iframe>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<form name="cform" method="post" action="<%=contextPath %>/Dispatcher">
<input type="hidden" name="pagename" value="p_opencriterion">
<input type="hidden" name="isfirst" value="N">
<input type="hidden" name="actionname">
<input type="hidden" name="currentnum">
<input type="hidden" name="datacategory">
<input type="hidden" name="issearch">
<input type="hidden" name="arraystr">
 <input type="hidden" name="numrows" value="<%=searchresults.size() %>"/>
<table width="100%" cellspacing="0">
  <% //--------------------------------------  page location --%>
	<%@ include file="/inc/PageLocation.inc" %>
</table>
	<table width="100%">
		 <tr>
    <td> 
      <table width="100%" border="0" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center" >  
          <tr>
               <%
               java.util.Calendar cal = java.util.Calendar.getInstance();    
               String year = cal.get(Calendar.YEAR)+"";     
		       String month = String.valueOf(cal.get(Calendar.MONTH)+1);
		       if(cal.get(Calendar.MONTH) == 0){
				  month = "12";
				  year = (cal.get(Calendar.YEAR)-1)+"";
			   }  
		       %>
		  <td>
		   <div align="right">
		   <%= label.getLabelName("L_Year1") + label.getLabelName("L_Colon") %>
		   </div>
		  </td>
          <td><custom:selectdic  property="searchyear" dictType="Years" label="L_Year1"  value="<%=year %>"/></td>
          <td>
		   <div align="right">
		   <%= label.getLabelName("L_Quarter") + label.getLabelName("L_Colon") %>
		   </div>
		  </td>
		  <td><custom:selectdic  property="searchquarter" dictType="Quarter" label="L_Quarter"/></td>
          <td class="title_center">
			<div align="right">
				<%=label.getLabelName("L_StdType")+ label.getLabelName("L_Colon")%>
			</div>
		  </td>
		  <td>
			 <custom:selectdic  property="searchcriteriontype" dictType="DicrelationType"  defaultValueCost="" defaultValue="--------------" />
	      </td>
          <td class="title_center">
			<div align="right">
				<%=label.getLabelName("L_Department")+ label.getLabelName("L_Colon")%>
			</div>
		  </td>
		  <td>
			 <custom:select property="searchdeptid" optionsName="alldeptnames" optionValueKey="deptid" optionInnerTextKey="deptname" defaultValue="--------" defaultValueCost=""/>
	      </td>
		  <td class="title_center">
			<div align="right">
				<%=label.getLabelName("L_Provicetdr")+label.getLabelName("L_Colon")%>
			</div>
		  </td>
		  <td>
			<custom:text property="regionname" 
			size="20" readonly="false" style="border:1px #7F9DB9 solid;" /> <a
			onClick="javascript:page_popBusinessarea();"><custom:button type="3"
			label="L_Asterisk" imgsrc="flash.gif" border="0" /></a><custom:hidden property="regionareaid" />
		   </td>
		   <!-- 
		     <td class="title_center">
				<%=label.getLabelName("L_RegionOffice")+label.getLabelName("L_Colon")%>
		     </td>	
		     <td><custom:hidden  property="areaids" />
			  <custom:text  property="businessareanames" size="20" label="L_BusinessAreaName" readonly="true"/>&nbsp;<a onclick="popBusinessarea_moulty()"><custom:button type="3" value="*"/></a>
		     </td>
		    -->
		   <td class="title_center">
			<div align="right">
				<%=label.getLabelName("L_ProductGroupName")+label.getLabelName("L_Colon")%>
			</div>
		   </td>	
		   <td>
			<custom:text property="pdgroupname" size="15"  ></custom:text>
			<a onclick="popContactProd();"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0" /></a>
			<custom:hidden  property="pdgroupid" />
			&nbsp;&nbsp;<a href="javascript:page_summary('search')"><img src="<%= ConstantProp.DEFAULT_ROOT_PATH %>/images/<%= strLanguageCode %>/ss.png" border="0" ></a>
		   </td>		
          </tr>
	  </table>
      <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellpadding="0" width="100%">
          <tr class="deepblue-left">
          <td width="1%" class="title_center">&nbsp;</td>
          <td width="4%" class="title_center"><a href="javascript:page_summary('orderby','year')"><%=label.getLabelName("L_Year1")%></a><span class='red'>*</span></td>
          <td width="2%" class="title_center"><a href="javascript:page_summary('orderby','quarter')"><%=label.getLabelName("L_Quarter")%></a><span class='red'>*</span></td>
          <td width="7%" class="title_center"><a href="javascript:page_summary('orderby','criteriontype')"><%=label.getLabelName("L_StdType")%></a><span class='red'>*</span></td>
          <td width="7%" class="title_center"><a href="javascript:page_summary('orderby','deptid')"><%=label.getLabelName("L_Dept")%></a><span class='red'>*</span></td>
          <!-- <td width="7%" class="title_center"><a href="javascript:page_summary('orderby','opentype')"><%=label.getLabelName("L_Type")%></a><span class='red'>*</span></td>-->
          <td width="11%" class="title_center"><a href="javascript:page_summary('orderby','stdareaname')"><%=label.getLabelName("L_Provicetdr")%></a><span class='red'>*</span></td>
          <!-- <td width="12%" class="title_center"><a href="javascript:page_summary('orderby','areaname')"><%=label.getLabelName("L_RegionOffice")%></a><span class='red'>*</span></td> -->
          <td width="12%" class="title_center"><a href="javascript:page_summary('orderby','productgroupname')"><%=label.getLabelName("L_ProductGroupName")%></a><span class='red'>*</span></td>
          <%-- 
          <td class="15%" class="title_center"><a href="javascript:page_summary('orderby','year')"><%=label.getLabelName("L_Grade")%></a><span class='red'>*</span></td>
          --%>
          <td width="10%" class="title_center"><a href="javascript:page_summary('orderby','analyzecriteria')"><%=label.getLabelName("L_Grade")%></a><span class='red'>*</span></td>
          <td width="10%" class="title_center"><a href="javascript:page_summary('orderby','unit')"><%=label.getLabelName("L_UOM1")%></a><span class='red'>*</span></td>
          <td width="4%" class="title_center"><a href="javascript:page_summary('orderby','qty')"><%=label.getLabelName("L_Value")%></a><span class='red'>*</span></td>
          <!--  
          <td width="12%" class="title_center"><a href="javascript:page_summary('orderby','datelastupdated')"><%=label.getLabelName("L_Datelastupdate")%></a></td>
          -->
          </tr>
          <%
             int j = 0;
             int s=1;
             String strClassType = new String();
             String strIsChecked = "";
             Integer defaultId = new Integer(-1);
             boolean bHasChecked = false;
            
          %>
          <logic:iterate id="pageconfig" collection="<%= searchresults %>" indexId="seq">
          	<%
            HashMap pageConfig = (HashMap)pageContext.getAttribute("pageconfig");
            if(j%2 == 1){
              strClassType = "td-listrom";
            }else{
              strClassType = "";
            }

           if(!bHasChecked)
            {
              strIsChecked = "Checked";
              //System.out.print("opencriterionid="+pageConfig.get("opencriterionid"));
              defaultId = (Integer)pageConfig.get("opencriterionid");
              bHasChecked = true;
              
            }else{
           		strIsChecked = "";
            }
             s= ((Integer)pageConfig.get("opencriterionid")).intValue();
            j++;
          %>
          	<tr  class="<%=JspHelper.filterNull(strClassType)%>">
          	    <%if(((Integer)pageConfig.get("flag")).intValue()==0){ %>
          	    <td width="1%" class="title_center"><input type="checkbox" name="deleteids" value="<%=JspHelper.filterNull( pageConfig.get("opencriterionid") )%>" class="checkbox"></td>
	            <custom:hidden name="pageconfig" property="opencriterionid"   colIndex="<%=seq %>"/>
	            <td class="title_center"><custom:write name="pageconfig" property="year" dictType="Years" nbsp="true" /></td>
	            <td class="title_center"><custom:write name="pageconfig" property="quarter" dictType="Quarter" nbsp="true"/></td>
    	        <td class="title_center"><custom:write name="pageconfig" property="criteriontype" nbsp="true" dictType="DicrelationType"/></td>
    	        <custom:hidden name="pageconfig" property="criteriontype"  colIndex="<%=seq %>"/>
    	        <custom:hidden name="pageconfig" property="deptid"  colIndex="<%=seq %>"/>
    	        <custom:hidden name="pageconfig" property="datacategory"  colIndex="<%=seq %>"/>
	            <td class="title_center"><custom:write name="pageconfig" property="deptname" nbsp="true"/></td>
	            <!--<td class="title_center"><custom:write  name="pageconfig" property="opentype" nbsp="true" dictType="OpenType"/></td>-->
	            <td class="title_center">
				   <custom:text property="stdareaname" name="pageconfig" size="15" label="L_Standard_Business" readonly="true" colIndex="<%=seq %>"/> 
				   <a onClick="javascript:page_popBusinessarea(<%=seq %>);"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0" /></a>
				   <custom:hidden property="areaid1"  name="pageconfig" colIndex="<%=seq %>"/>
	            </td>
	            <!-- <td class="title_center"><custom:write name="pageconfig" property="areaname"  nbsp="true"/></td> -->
	            <td class="title_center">
	                <custom:text name="pageconfig" property="productgroupname" command="notnull" size="15" label="L_ProductGroupName" colIndex="<%=seq %>" readonly="true"/>
				    <a onclick="popWindowsContactProd(<%=seq %>);"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0" /></a>
				    <custom:hidden name="pageconfig" property="productgroupid"  colIndex="<%=seq %>"/>
	            </td>
	            <%if(((Integer)pageConfig.get("criteriontype")).intValue()==1 || ((Integer)pageConfig.get("criteriontype")).intValue()==2){%>
	            <td><custom:selectdic name="pageconfig" property="analyzecriteria"  dictType="HProcessType"  colIndex="<%=seq %>"/></td>
	            <%} %>
	            <%if(((Integer)pageConfig.get("criteriontype")).intValue()==3){%>
	            <td><custom:selectdic name="pageconfig" property="analyzecriteria"  dictType="HProcessType"  colIndex="<%=seq %>"/></td>
	            <%} %>
	            <td class="title_center"><custom:selectdic name="pageconfig" property="unit"  dictType="UomType"  colIndex="<%=seq %>" valueCriteria="4,6"/></td>
	            <td class="title_center"><custom:text name="pageconfig" property="qty"  colIndex="<%=seq %>" size="4"/></td>
	            <!--  
	            <td>&nbsp;<custom:write name="pageconfig" property="datelastupdated"  nbsp="true"/></td>
	            -->
	            <%}else{ %>
	            <td width="1%" class="title_center"><input type="checkbox" name="deleteids" value="<%=JspHelper.filterNull( pageConfig.get("opencriterionid") )%>" class="checkbox" disabled="disabled"></td>
	            <custom:hidden name="pageconfig" property="opencriterionid"   colIndex="<%=seq %>"/>
	            <td class="title_center"><custom:write name="pageconfig" property="year" dictType="Years" nbsp="true" /></td>
	            <td class="title_center"><custom:write name="pageconfig" property="quarter" dictType="Quarter" nbsp="true"/></td>
    	        <td class="title_center"><custom:write name="pageconfig" property="criteriontype" nbsp="true" dictType="DicrelationType"/></td>
	            <td class="title_center"><custom:write name="pageconfig" property="deptname" nbsp="true"/></td>
	            <td class="title_center"><custom:write name="pageconfig" property="stdareaname" nbsp="true"/></td>
	            <td class="title_center"><custom:write name="pageconfig" property="productgroupname" nbsp="true"/></td>
	            <%if(((Integer)pageConfig.get("criteriontype")).intValue()==1 || ((Integer)pageConfig.get("criteriontype")).intValue()==2){%>
	            <td class="title_center"><custom:write name="pageconfig" property="analyzecriteria"  dictType="HProcessType"  nbsp="true"/></td>
	            <%} %>
	            <!-- 
	            <td class="title_center"><custom:write name="pageconfig" property="analyzecriteria"  dictType="PProcessType"  nbsp="true"/></td>
	             -->
	            <%if(((Integer)pageConfig.get("criteriontype")).intValue()==3){%>
	            <td class="title_center"><custom:write name="pageconfig" property="analyzecriteria"  dictType="HProcessType"  nbsp="true"/></td>
	            <%} %>
	            <td class="title_center"><custom:write name="pageconfig" property="unit"  dictType="UomType"  nbsp="true"/></td>
	            <td class="title_center"><custom:write name="pageconfig" property="qty"  nbsp="true" /></td>
	            <%} %>
	         </tr>
          </logic:iterate>
           <tr class="none">
	           <td>&nbsp;</td>
		       <td class="title_center"><custom:selectdic  name="newhash" property="year" dictType="Years" label="L_Year1"  value="<%=year %>"/></td>
		       <td class="title_center"><custom:selectdic name="newhash"  property="quarter" dictType="Quarter" label="L_Quarter" value="<%=month %>"/></td>
	           <td class="title_center"><custom:selectdic name="newhash" property="criteriontype" dictType="DicrelationType" command="notnull" label="L_StdType" defaultValueCost=" " defaultValue="--------------" onchange="selectattribute()"/></td>
	           <td class="title_center"><custom:select name="newhash" command="notnull" optionsName="alldeptnames" optionValueKey="deptid" optionInnerTextKey="deptname"	property="deptid"  defaultValue="----" defaultValueCost=" " label="L_Dept" onchange="clearprd()"/></td>
	           <!--  <td><custom:selectdic name="newhash" property="opentype" dictType="OpenType"  label="L_StdType" defaultValueCost=" " defaultValue="--------------" /></td>-->
	           <td class="title_center">
	           	<custom:hidden name="newhash" property="areaidstr" label="L_Provicetdr" command="notnull"/>
				<custom:text property="stdareaname" name="newhash" size="15" label="L_Standard_Business" readonly="true" /> 
				<a onclick="popBusinessarea()"><custom:button type="3" value="*" /></a>
	           </td>
	           <!-- 
	           <td>
	           	<custom:text property="areaname" command="notnull" size="15" label="L_RegionOffice" ></custom:text>
				<a onclick="popAreaNew();"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0" /></a>
				<custom:hidden name="newhash" property="areaid2" />
	           </td>
	            -->
	           <td class="title_center">
	           	<custom:text property="productgroupname" command="notnull" size="15" label="L_ProductGroupName" ></custom:text>
				<a onclick="popWindowsContactProd();"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0" /></a>
				<custom:hidden name="newhash" property="productgroupid" />
	           </td>
	           <td class="title_center">
	            <div style="display:none;" id="div1" class="div1">
	           	  <custom:select name="newhash" property="analyzecriteria" optionsName="attribute1" optionValueKey="value" optionInnerTextKey="valuename"  defaultValue="--------------" defaultValueCost=" "/>
	            </div> &nbsp;
	           </td>
	           <td class="title_center"><custom:selectdic name="newhash" property="unit" dictType="UomType" command="notnull" label="L_UOM1" defaultValueCost=" " defaultValue="---------" valueCriteria="4,6"/></td>
	           <td class="title_center"><custom:text property="qty" command="notnull" label="L_Value" size="4"></custom:text></td>
		     </tr>
          <input type="hidden" name="datecollateid" value="<%=JspHelper.filterNull( defaultId )%>">
    <% //--------------------------------------  flipping page --%>
    <%@ include file="/inc/SummaryAction.inc" %>
    <table width="100%">
        <tr> 
          <td class="summary_top"></td>
        </tr>
		<tr >
			  <td class="td_center">
	           <a onclick="page_add();"><custom:button type="1" label="L_Add" imgsrc="add.gif" border="0" style="width:60"/></a>
               <%
                if(searchresults.size() >0 ){
               %>
               <a onclick="page_save();"><custom:button type="1" label="L_Save" imgsrc="save.gif" border="0" style="width:60"/></a>
               <a onclick="page_delete();"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
               <%}%>
	          </td>
	          
		</tr>
	</table>	
   </table>
</form>
</table>


</body>
</html>


